<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
    <title>文档编辑</title>

    <link rel="stylesheet" href="${ctx}/static/styles/std_detail.css" type="text/css">

    <script src="${ctx}/static/js/jquery-2.1.1.min.js" type="text/javascript"></script>
    <script src="${ctx}/static/js/pdfobject.min.js"></script>

    <script>
        $(document).ready(function () {
            PDFObject.embed("${ctx}/resource/docs/${doc.location}", "#ex");
        });</script>
    <script>
        $('textarea').each(function () {
            this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
        }).on('input', function () {
            this.style.height = 'auto';
            this.style.height = (this.scrollHeight) + 'px';
        });</script>
</head>

<body>
<div class="std-main">
    <div class="container">
        <h5>文档信息编辑</h5>
        <div class="row" style="padding-bottom: 50px">
            <form id="inputForm" action="${ctx}/doc/update" method="post" class="form-horizontal">
                <input type="hidden" name="id" value="${doc.id}"/>
                <input type="hidden" name="language" value="${doc.language}"/>
                <input type="hidden" name="createDate" value="${doc.createDate}"/>
                <input type="hidden" name="location" value="${doc.location}"/>
                <input type="hidden" name="docTime" value="${doc.docTime}"/>
                <div class="doc_edit_detail">
                    <div class="std-info">
                        <div class="input-group">
                            <span class="input-group-addon">标题：</span><input type="text" name="title"
                                                                             value="${doc.title}"
                                                                             class="form-control"></p>
                        </div>
                        <div class="input-group">
                            <span class="input-group-addon">摘要：</span><input type="text" name="summary"
                                                                             value="${doc.summary}"
                                                                             class="form-control"></p>
                        </div>

                        <div class="input-group">
                            <span class="input-group-addon">作者：</span><input type="text" name="authors"
                                                                             value="${doc.authors}"
                                                                             class="form-control"></p>
                        </div>
                        <div class="input-group">
                            <span class="input-group-addon">描述：</span><input type="text" name="description"
                                                                             value="${doc.description}"
                                                                             class="form-control"></p>
                        </div>

                        <div class="input-group">
                            <span class="input-group-addon">主题：</span><input type="text" name="subject"
                                                                             value="${doc.subject}"
                                                                             class="form-control"></p>
                        </div>
                        <div class="input-group">
                            <span class="input-group-addon">标签：</span><input type="text" name="tags"
                                                                             value="${doc.tags}"
                                                                             class="form-control"></p>
                            <span class="input-group-addon">关键词：</span><input type="text" name="keywords"
                                                                              value="${doc.keywords}"
                                                                              class="form-control"></p>
                        </div>
                        <%--<div class="input-group">--%>
                        <%--<span class="input-group-addon">PDF路径：</span><input type="text" name="location"--%>
                        <%--id="pdfPath2"--%>
                        <%--value="${doc.location}"--%>
                        <%--class="form-control"></p>--%>
                        <%--</div>--%>
                        <div class="input-group">
                            <span class="input-group-addon">正文：</span>
                            <textarea id="contentArea" style="height: 400px; width: 933px;"
                                      name="content">${doc.content}</textarea>
                        </div>
                    </div>
                </div>

                <div class="news-btn-area">
                    <button type="submit" class="btn btn-success info-submit">
                        <span class="glyphicon glyphicon-ok"></span> 发布
                    </button>
                    <button type="reset" class="btn btn-danger">
                        <span class="glyphicon glyphicon-remove"></span> 重置
                    </button>
                </div>
            </form>
        </div>

    </div>
</div>
</body>
</html>
